function checkvote(type,id,vote,user){
	if(user==null || user==''){
		alert("请先登录！");
		return false;
	}else{
		$.post("../checkVote", { id: id,userId:user},function(data){
			if(data=='true'){
				if (vote=="t") {
					if (type=="article") {
						window.location="../vote?id="+id+"&vote=1";
					} else if (type=="circle") {
						window.location="../vote?id="+id+"&vote=1";
					}else if (type=="blog") {
						window.location="../vote?id="+id+"&vote=1";
					}
				} else if(vote=="f"){
					if (type=="article") {
						window.location="../vote?id="+id+"&vote=-1";
					} else if (type=="circle") {
						window.location="../vote?id="+id+"&vote=-1";
					}else if (type=="blog") {
						window.location="../vote?id="+id+"&vote=-1";
					}
				}
			}else if(data=='false'){
				alert("您已经投过票了！");
			}
		});		
	}
}
